package ooday02;
/** 继承的测试 */
public class ExtendsTest {
    public static void main(String[] args) {
        Student zg = new Student();
        zg.name = "张光";
        zg.age = 23;
        zg.address = "廊坊";
        zg.className = "jsd2310";
        zg.stuId = "001";
        zg.eat();
        zg.sleep();
        zg.sayHi();
        zg.study();

        Student ll = new Student("李林",22,"佳木斯","jsd2310","002");
        ll.eat();
        ll.sleep();
        ll.sayHi();
        ll.study();

        Teacher zq = new Teacher("赵强",36,"山东",6000.0);
        zq.eat();
        zq.sleep();
        zq.sayHi();
        zq.teach();

        Doctor sx = new Doctor("孙旭",45,"山西","主任医师");
        sx.eat();
        sx.sleep();
        sx.sayHi();
        sx.cut();

        //演示超类不能访问派生类的
        Person p = new Person();
        p.name = "人";
        p.age = 1;
        p.address = "未知";
        p.eat();
        p.sleep();
        p.sayHi();
    }
}















